package com.klikmee.sms.core.commons.exceptions;

import java.util.ArrayList;
import java.util.List;

/**
 * This is base class for application exceptions in sms core platform
 */
public class ApplicationException extends Exception {
	
	private static final long	serialVersionUID	= 1419551467108767767L;
	
	protected List<ErrorInfo>	errorInfoList	= new ArrayList<ErrorInfo>();

	public ApplicationException() {
	}
	
	public ApplicationException(String message){
		super( message );
	}

	public ApplicationException(String message, Throwable cause){
		super(message, cause);
	}
	
	public ErrorInfo addInfo(ErrorInfo info) {
		this.errorInfoList.add(info);
		return info;
	}

	public ErrorInfo addInfo() {
		ErrorInfo info = new ErrorInfo();
		this.errorInfoList.add(info);
		return info;
	}

	public List<ErrorInfo> getErrorInfoList() {
		return errorInfoList;
	}
}
